package com.itheima3;
//视频P121

import java.util.Scanner;

public class Login_interface {
    public static void main(String[] args) {
        String name = "BABA";
        String password = "123456";
        for (int i = 0; i < 3; i++) {
            Scanner sc = new Scanner(System.in);

            System.out.println("请输入用户名");
            String Name = sc.nextLine();

            System.out.println("请输入密码");
            String pwd = sc.nextLine();


            if (name.equals(Name) && pwd.equals(password)) {
                System.out.println("你真他妈是个天才");
                break;
            } else {
                if (i == 2) {
                    System.out.println("账户被锁定");
                } else
                    System.out.println("用户名或密码错误，还有" + (2 - i) + "次机会");
            }

        }
    }
}
